#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "playwindow.h"
#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QImage* img=new QImage;

    //加载图像
    if(! ( img->load(":/pic/pic/1Negative.jpg") ) ) {
        QMessageBox::information(this,
                                 tr("打开图像失败"),
                                 tr("打开图像失败!"));
        delete img;
        return;
    }
    QImage* imgScaled = new QImage;
    *imgScaled=img->scaled(200,
                           175,
                           Qt::KeepAspectRatio);
    ui->label->setPixmap(QPixmap::fromImage(*imgScaled));

//    ui->label->setPixmap(QPixmap::fromImage(*img));

}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_start_clicked(bool checked)
{
    playWindow *win = new playWindow;
//    win->showFullScreen();
    win->show();
}
